<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>信美恋爱</title>
    <meta name="description" content="信美恋爱">
    <meta name="keywords" content="信美恋爱">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="icon" href="../img/logoK.png" type="image/x-icon"/>
    <style type="text/css">
        .el-main {
            position: absolute;
            top: 70px;
            bottom: 0px;
            left: 200px;
            right: 10px;
            padding: 0;
        }
    </style>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div id="app">
    <el-container>
        <el-header class="main-header" style="height:70px;">
            <nav class="navbar navbar-static-top" :class=''>
                <!-- &lt;!&ndash; Logo &ndash;&gt;-->
                <div class="logo" style="text-align:center">
                    <span class="logo-lg" style="color: red; size: 10px"><!--<img src="../img/logo1.png" height="45">--><b><i>信美恋爱后台管理系统</i></b></span>
                </div>
                <div class="right-menu">
                    <el-dropdown class="avatar-container right-menu-item" trigger="click">
                        <div class="avatar-wrapper">
                            <img :src="image" class="user-avatar">
                            <!--显示用户名-->
                            {{username}}
                        </div>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item divided>
                                <span style="display:block;"><a href="/logout">退出</a></span>
                            </el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
            </nav>
        </el-header>
        <el-container>
            <el-aside width="200px">
                <el-menu>
                    <el-submenu v-for="menu in menuList" :index="menu.path">
                        <template slot="title">
                            <i class="fa" :class="menu.icon"></i>
                            {{menu.title}}
                        </template>
                        <template v-for="child in menu.children">
                            <el-menu-item :index="child.path">
                                <a :href="child.linkUrl" target="right">{{child.title}}</a>
                            </el-menu-item>
                        </template>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-container>
                <iframe name="right" class="el-main" src="report_TodayOrder.html" width="100%" height="100%"
                        frameborder="0"></iframe>
            </el-container>
        </el-container>
    </el-container>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            username: null,
            status: '',
            image: '',
            menuList: []
        },
        created() {
            axios.get("/getUser").then((response) => {
                // 对username模型赋值
                this.username = response.data.data.username;
                this.status = response.data.data.status;
                this.image = response.data.data.image;
                if (this.status == 2) {
                    this.menuList = [
                        {
                            "path": "1",
                            "title": "运营状态",
                            "icon": "fa-handshake-o",
                            "children": [
                                {
                                    "path": "/1-1",
                                    "title": "今日订单销售",
                                    "linkUrl": "report_TodayOrder.html",
                                    "children": []
                                },
                                {
                                    "path": "/1-2",
                                    "title": "最近订单总数",
                                    "linkUrl": "Time.html",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "path": "2",
                            "title": "商城管理",
                            "icon": "fa-truck",
                            "children": [
                                {
                                    "path": "/2-1",
                                    "title": "公告栏管理",
                                    "linkUrl": "announcement.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-2",
                                    "title": "轮播图管理",
                                    "linkUrl": "shufflingFigure.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-3",
                                    "title": "商品管理",
                                    "linkUrl": "goods.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-4",
                                    "title": "积分商品管理",
                                    "linkUrl": "integrals.html",
                                    "children": []
                                }, {
                                    "path": "/2-5",
                                    "title": "积分商品分类管理",
                                    "linkUrl": "integralgoods_class.html",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "path": "3",
                            "title": "订单管理",
                            "icon": "fa-tty",
                            "children": [
                                {
                                    "path": "/3-1",
                                    "title": "商品订单管理",
                                    "linkUrl": "order.html",
                                    "children": []
                                },
                                {
                                    "path": "/3-2",
                                    "title": "积分商品订单管理",
                                    "linkUrl": "integral_order.html",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "path": "4",
                            "title": "会员管理",
                            "icon": "fa-id-card ",
                            "children": [
                                {
                                    "path": "/4-1",
                                    "title": "会员档案",
                                    "linkUrl": "user.html",
                                    "children": []
                                },
                                {
                                    "path": "/4-2",
                                    "title": "会员统计",
                                    "linkUrl": "report_member.html",
                                    "children": []
                                },
                                {
                                    "path": "/4-3",
                                    "title": "管理员设置",
                                    "linkUrl": "admin_user.html",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "path": "5",     //菜单项所对应的路由路径
                            "title": "系统设置",     //菜单项名称
                            "icon": "fa-cog",
                            "children": [//是否有子菜单，若没有，则为[]
                                {
                                    "path": "/5-1",
                                    "title": "兑换管理",
                                    "linkUrl": "cashDiscount.html",
                                    "children": []
                                },
                                {
                                    "path": "/5-2",
                                    "title": "商品码管理",
                                    "linkUrl": "qualityGoods.html",
                                    "children": []
                                },
                                {
                                    "path": "/5-3",
                                    "title": "规则明细",
                                    "linkUrl": "the_Rules.html",
                                    "children": []
                                },
                                {
                                    "path": "/5-4",
                                    "title": "关于我们",
                                    "linkUrl": "the_problem.html",
                                    "children": []
                                }
                            ]
                        }
                    ]
                }
                if (this.status == 1) {
                    this.menuList = [
                        {
                            "path": "1",
                            "title": "运营状态",
                            "icon": "fa-handshake-o",
                            "children": [
                                {
                                    "path": "/1-1",
                                    "title": "今日订单销售",
                                    "linkUrl": "report_TodayOrder.html",
                                    "children": []
                                },
                                {
                                    "path": "/1-2",
                                    "title": "最近订单总数",
                                    "linkUrl": "Time.html",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "path": "2",
                            "title": "商城管理",
                            "icon": "fa-truck",
                            "children": [
                                {
                                    "path": "/2-1",
                                    "title": "公告栏管理",
                                    "linkUrl": "announcement.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-2",
                                    "title": "轮播图管理",
                                    "linkUrl": "shufflingFigure.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-3",
                                    "title": "商品管理",
                                    "linkUrl": "goods.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-4",
                                    "title": "积分商品管理",
                                    "linkUrl": "integrals.html",
                                    "children": []
                                }, {
                                    "path": "/2-5",
                                    "title": "积分商品分类管理",
                                    "linkUrl": "integralgoods_class.html",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "path": "3",
                            "title": "订单管理",
                            "icon": "fa-tty",
                            "children": [
                                {
                                    "path": "/3-1",
                                    "title": "商品订单管理",
                                    "linkUrl": "order.html",
                                    "children": []
                                },
                                {
                                    "path": "/3-2",
                                    "title": "积分商品订单管理",
                                    "linkUrl": "integral_order.html",
                                    "children": []
                                }
                            ]
                        },
                    ]
                }
                if (this.status == 0) {
                    this.menuList = [{
                        "path": "1",
                        "title": "运营状态",
                        "icon": "fa-handshake-o",
                        "children": [
                            {
                                "path": "/1-1",
                                "title": "今日订单销售",
                                "linkUrl": "report_TodayOrder.html",
                                "children": []
                            },
                            {
                                "path": "/1-2",
                                "title": "最近订单总数",
                                "linkUrl": "Time.html",
                                "children": []
                            }
                        ]
                    },
                        {
                            "path": "2",
                            "title": "商城管理",
                            "icon": "fa-truck",
                            "children": [
                                {
                                    "path": "/2-1",
                                    "title": "公告栏管理",
                                    "linkUrl": "announcement.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-2",
                                    "title": "轮播图管理",
                                    "linkUrl": "shufflingFigure.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-3",
                                    "title": "商品管理",
                                    "linkUrl": "goods.html",
                                    "children": []
                                },
                                {
                                    "path": "/2-4",
                                    "title": "积分商品管理",
                                    "linkUrl": "integrals.html",
                                    "children": []
                                }, {
                                    "path": "/2-5",
                                    "title": "积分商品分类管理",
                                    "linkUrl": "integralgoods_class.html",
                                    "children": []
                                }
                            ]
                        }]
                }
                console.log(response.data.data.status)
            });
            /*            axios.get("/getMenuList").then((res)=>{
                        this.menuList = res.data.data;
                        console.log(res)
                    });*/
        },
    });
    $(function () {
        var wd = 200;
        $(".el-main").css('width', $('body').width() - wd + 'px');
    });
</script>
</html>
